<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:mo="https://gitee.com/aun/Timo">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
    <link rel="stylesheet" th:href="@{/lib/zTree_v3/css/zTreeStyle/zTreeStyle.css}" type="text/css">
</head>
<body class="timo-layout-page">
    <div class="layui-card">
        <div class="layui-card-header timo-card-header">
            <span><i class="fa fa-bars"></i> 凭据兑换</span>
            <i class="layui-icon layui-icon-refresh refresh-btn"></i>
            <a th:href="@{/system/user/export}"><i class="fa fa-download"></i></a>
        </div>
        <div class="layui-card-body">
            <div class="layui-row timo-card-screen put-row">
                <div class="pull-left layui-form-pane timo-search-box">
                    <form class="layui-form" >
                    <div class="layui-inline">
                        <label class="layui-form-label">用户昵称</label>
                        <div class="layui-input-block">
                            <input type="text" name="nickname" th:value="${nickName}" placeholder="请输入用户昵称" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">状态选择</label>
                        <div class="layui-input-inline">
                            <select name="states" lay-verify="required" id="states" lay-filter="states" >
                                <option value="0" th:selected="${states ==0}">待审核</option>
                                <option value="1" th:selected="${states ==1}">未通过</option>
                                <option value="2" th:selected="${states ==2}">已通过</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn timo-search-btn">
                            <i class="fa fa-search"></i>
                        </button>
                    </div>
                    </form>
                </div>
            </div>
            <div class="timo-table-wrap">
                <table class="layui-table timo-table">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>提交时间</th>
                        <th>用户昵称</th>
                        <th>用户手机</th>
                        <th>凭证预览</th>
                        <th>机构名称</th>
                        <th>兑换积分</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="item:${list}">
                        <td th:text="${item.selNum}" style="text-align: center"></td>
                        <td th:text="${item.createTime}"></td>
                        <td th:text="${item.nickName}"></td>
                        <td th:text="${item.phone}"></td>
                        <td>
                            <a class="open-popup"  style="cursor: pointer" th:attr="data-url=@{${item.imageUrl}}" data-size="600,570" href="#">预览</a>
                        </td>
                        <td th:text="${item.companyName}"></td>
                        <td th:text="${item.points}"></td>
                        <td th:text="${item.status}"></td>
                        <td>
                            <a th:if="${item.states ==0}" class="open-popup" data-title="处理凭证" th:attr="data-url=@{'/mains/bill/verify/'+${item.id}}"  data-size="450,580" href="#">处理</a>
                            <a th:if="${item.states ==1}" class="open-popup" data-title="凭证详情" th:attr="data-url=@{'/mains/bill/detail/'+${item.id}}"  data-size="375,260" href="#">详情</a>
                            <a th:if="${item.states ==2}" class="open-popup" data-title="凭证详情" th:attr="data-url=@{'/mains/bill/detail/'+${item.id}}"  data-size="375,260" href="#">详情</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div th:replace="/common/fragmentSelf :: page"></div>
        </div>
    </div>
<script th:replace="/common/template :: script"></script>
<script type="text/javascript" th:src="@{/js/plugins/jquery-3.3.1.min.js}"></script>
<script type="text/javascript" th:src="@{/lib/zTree_v3/js/jquery.ztree.core.min.js}"></script>
<script type="text/javascript" th:src="@{/js/timoTree.js}"></script>
<script type="text/javascript">
    layui.use(['form','laydate'] ,function() {
        var laydate = layui.laydate,
            form  = layui.form;
        laydate.render({
            elem: '#time'
            ,type: 'datetime'
        });
    })
    var local = window.localStorage;
    // 树形菜单
    $.fn.selectTree({
        rootTree: '全部',
        onSelected: function(treeNode){
            local.setItem('deptTitle', treeNode.name);
        }
    });
</script>
</body>
</html>
